<?php

function _routes($routes){


    $routes->get('/', 'LoginController::test');


//    主体功能
    $routes->group('admin/auth',function($routes){
        $routes->post('login', 'LoginController::login');
        $routes->get('logout', 'LoginController::logout',['filter'=>'auth']);
        $routes->post('register', 'LoginController::register');
        $routes->get('unregister', 'LoginController::unregister',['filter'=>'auth']);
    });


//    个人信息
    $routes->group('home/auth',function($routes){
        $routes->post('about', 'UserController::userinfo',['filter'=>'auth']);
        $routes->post('update', 'UserController::doUpdateInfo',['filter'=>'auth']);
        $routes->post('password', 'UserController::doUpdatePwd',['filter'=>'auth']);
    });


//    管理功能
    $routes->group('admin/auth',function($routes){
        $routes->post('searchAll', 'AdminController::searchAll',['filter'=>'auth']);
        $routes->post('searchDelAll', 'AdminController::searchDelAll',['filter'=>'auth']);
        $routes->post('searchUseAll', 'AdminController::searchUseAll',['filter'=>'auth']);
        $routes->get('search', 'AdminController::search',['filter'=>'auth']);
    });
}